import java.util.Iterator;
import java.util.LinkedList;

public class TestQQ 
{
	public static void main(String[] args)
	{
		LinkedList<String> chains=new LinkedList<String>();
		String[] strs= {"12345","67891","12347809933","98765432102","67891","12347809933"};
		for(int i=0;i<strs.length;i++)
		{
			chains.add(strs[i]);
		}
		for(int i=0;i<chains.size();i++)
		{
			for(int j=i+1;j<chains.size();j++)
			{
				if(chains.get(i).equals(chains.get(j)))
				{
					chains.remove(j);
					j--;
				}
			}
		}
		Iterator<String> it=chains.iterator();
		while(it.hasNext())
		{
			System.out.print(it.next()+" ");
		}
		System.out.println();
		for(String s:chains)
		{
			System.out.print(s+" ");
		}
		System.out.println();
		System.out.println(chains);
	}
}
